﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CompanyOrder2.aspx.cs"
    Inherits="NJL.Web.CompanyOrder2" %>

<%@ Register Src="Controls/WUCHeader1.ascx" TagName="WUCHeader1" TagPrefix="uc1" %>
<%@ Register Src="Controls/WUCFooter1.ascx" TagName="WUCFooter1" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>订单确认-农家乐网</title>
    <link href="/Styles/base1.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/manage.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="/Scripts/md5.js" type="text/javascript"></script>
    <script src="/Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="/Scripts/popup_layer.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            autoCount();
        });
        //自动计算
        autoCount = function () {
            var value = $('#spanTicketCount').html();
            var vLocalPrice = $('#spanLocalPrice').html();
            $('#spanAllPrice').html(vLocalPrice * value);
            $('#hidTotalPrice').val(vLocalPrice * value);
        }

        //订票数据两边处理
        checkTicketCount = function () {
            var reg = /^([1-9]{1}[0-9]{1})|([1-9]{1})$/;
            var value = $('#txtTicketCount').val();

            if (value != '') {
                if (!reg.test(value)) {
                    $('#txtTicketCount').val('');
                }
            }
            value = $('#txtTicketCount').val();
            if (value == '') {
                $('#spanTicketCount').html(1);

                $('#spanAlertTicketCount').show();
            }
            else {
                $('#spanTicketCount').html(value);
                $('#spanAlertTicketCount').hide();
            }

            //计算
            autoCount();
        }

        //提交个人信息认证
        checkPersonInfo = function () {
            var vReturnValue = true;

            var vSelectPick = $('#selPick').val();
            var vSelectBook = $('#selBook').val();

            var regDate = /^((?!0000)[0-9]{4}-((0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-8])|(0[13-9]|1[0-2])-(29|30)|(0[13578]|1[02])-31)|([0-9]{2}(0[48]|[2468][048]|[13579][26])|(0[48]|[2468][048]|[13579][26])00)-02-29)$/;
            var regName = /^(\w|[\u4E00-\u9FA5]){1,20}$/;
            var regMobile = /^1[3,4,5,8][\d]{9}$/;
            var regEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;

            var vPickName = $('#txtPickName').val();
            var vPickMobile = $('#txtPickMobile').val();
            var vPickEmail = $('#txtPickEmail').val();

            var vBookName = $('#txtBookName').val();
            var vBookMobile = $('#txtBookMobile').val();
            var vBookEmail = $('#txtBookEmail').val();


            //出游日期
            var vTripDate = $('#txtTripDate').val();
            if (regDate.test(vTripDate)) {

                var dtime = new Date();

                //如果预定今天的票
                //alert(dtime.getVarDate());
                var vYearString = dtime.getFullYear();
                var vMonthString = (dtime.getMonth() + 1) < 10 ? '0' + (dtime.getMonth() + 1) : (dtime.getMonth() + 1);
                var vDayString = (dtime.getDate() + 0) < 10 ? '0' + (dtime.getDate() + 0) : (dtime.getDate() + 0);
                var vDateString = vYearString + '-' + vMonthString + '-' + vDayString;
                //                alert(vDateString);
                //                alert(vTripDate);
                if (vDateString == vTripDate) {
                    var vHourString = dtime.getHours() < 10 ? '0' + (dtime.getHours() + 0) : (dtime.getHours() + 0);
                    var vMinuteString = dtime.getMinutes() < 10 ? '0' + (dtime.getMinutes() + 0) : (dtime.getMinutes() + 0);
                    var vTimeString = vHourString + ':' + vMinuteString;
                    //alert(vTimeString);
                    //alert($('#spanThatDayDeadline').html());
                    if (vTimeString > $('#spanThatDayDeadline').html()) {
                        alert('不能预定今天的了');
                        $('#spanTripDateLabel').show();
                        vReturnValue = false;
                    }
                    else {
                        $('#spanTripDateLabel').hide();
                    }
                }
                //
                if (vDateString > vTripDate) {
                    $('#spanTripDateLabel').show();
                    vReturnValue = false;
                }
                else {
                    $('#spanTripDateLabel').hide();
                }
            }
            else {
                $('#spanTripDateLabel').show();
                vReturnValue = false;
            }

            //预定票数量
            var regTicketCount = /^([1-9]{1}[0-9]{1})|([1-9]{1})$/;
            var value = $('#txtTicketCount').val();
            if (regTicketCount.test(value)) {
                $('#spanAlertTicketCount').hide();
            }
            else {
                $('#spanAlertTicketCount').show();
                vReturnValue = false;
                return vReturnValue;
            }

            //取票人信息//如果给别人订票-----------------------
            if ($('#hidBookForState').val() == '1') {

                if (regName.test(vPickName)) {
                    $('#spanPickName').hide();
                }
                else {
                    $('#spanPickName').show();
                    vReturnValue = false;
                    return vReturnValue;
                }

                if (vSelectPick == '1') {
                    if (regMobile.test(vPickMobile)) {
                        $('#spanPickMobile').hide();
                    }
                    else {
                        $('#spanPickMobile').show();
                        vReturnValue = false;
                        return vReturnValue;
                    }
                }
                else {
                    if (regEmail.test(vPickEmail)) {
                        $('#spanPickEmail').hide();
                    }
                    else {
                        $('#spanPickEmail').show();
                        vReturnValue = false;
                        return vReturnValue;
                    }
                }
            }

            if (regName.test(vBookName)) {
                $('#spanBookName').hide();
            }
            else {
                $('#spanBookName').show();
                vReturnValue = false;
                return vReturnValue;
            }

            if (vSelectBook == '1') {
                if (regMobile.test(vBookMobile)) {
                    $('#spanBookMobile').hide();
                    //                    if ($('#hidMobileActive').val() == '1') {
                    //                        $('#spanBookMobileCheck').hide();
                    //                    }
                    //                    else {
                    //                        $('#spanBookMobileCheck').show();
                    //                        vReturnValue = false;
                    //                        return vReturnValue;
                    //                    }
                }
                else {
                    $('#spanBookMobile').show();
                    vReturnValue = false;
                    return vReturnValue;
                }
            }
            else {
                $('#spanBookMobile').hide();
                $('#spanBookMobileCheck').hide();

                if (regEmail.test(vBookEmail)) {
                    $('#spanBookEmail').hide();
                }
                else {
                    $('#spanBookEmail').show();
                    vReturnValue = false;
                    return vReturnValue;
                }
            }

            return vReturnValue;
        }

        changeConnect = function () {
            var vSelectPick = $('#selPick').val();
            var vSelectBook = $('#selBook').val();

            if (vSelectPick == '1') {
                $('#spanPickMobileLabel').show();
                $('#spanPickEmailLabel').hide();
                $('#spanPickEmail').hide();
                $('#displayqpryx').hide();
            }
            else {
                $('#spanPickMobileLabel').hide();
                $('#spanPickEmailLabel').show();
                $('#spanPickMobile').hide();
                $('#displayqpryx').show();
            }

            if (vSelectBook == '1') {
                $('#spanBookMobileLabel').show();
                $('#spanBookEmailLabel').hide();
                $('#spanBookEmail').hide();
                //验证预定人的手机号码
                if ($('#hidMobileActive').val() != '1') {
                    $('#aMobileCheck').show();
                }
            }
            else {
                $('#spanBookMobileLabel').hide();
                $('#spanBookEmailLabel').show();
                $('#spanBookMobile').hide();
                //验证预定人的手机号码
                $('#aMobileCheck').hide();
            }
        }

        //单独校验出游日期
        checkTripDate = function () {
            var vReturnValue = true;
            var regDate = /^((?!0000)[0-9]{4}-((0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-8])|(0[13-9]|1[0-2])-(29|30)|(0[13578]|1[02])-31)|([0-9]{2}(0[48]|[2468][048]|[13579][26])|(0[48]|[2468][048]|[13579][26])00)-02-29)$/;
            //出游日期
            var vTripDate = $('#txtTripDate').val();
            if (regDate.test(vTripDate)) {

                var dtime = new Date();

                //如果预定今天的票
                //alert(dtime.getVarDate());
                var vYearString = dtime.getFullYear();
                var vMonthString = (dtime.getMonth() + 1) < 10 ? '0' + (dtime.getMonth() + 1) : (dtime.getMonth() + 1);
                var vDayString = (dtime.getDate() + 0) < 10 ? '0' + (dtime.getDate() + 0) : (dtime.getDate() + 0);
                var vDateString = vYearString + '-' + vMonthString + '-' + vDayString;

                if (vDateString == vTripDate) {
                    var vHourString = dtime.getHours() < 10 ? '0' + (dtime.getHours() + 0) : (dtime.getHours() + 0);
                    var vMinuteString = dtime.getMinutes() < 10 ? '0' + (dtime.getMinutes() + 0) : (dtime.getMinutes() + 0);
                    var vTimeString = vHourString + ':' + vMinuteString;

                    if (vTimeString > $('#spanThatDayDeadline').html()) {
                        alert('不能预定今天的了');
                        $('#spanTripDateLabel').show();
                        vReturnValue = false;
                    }
                    else {
                        $('#spanTripDateLabel').hide();
                    }
                }
                //
                if (vDateString > vTripDate) {
                    $('#spanTripDateLabel').show();
                    vReturnValue = false;
                }
                else {
                    $('#spanTripDateLabel').hide();
                }
            }
            else {
                $('#spanTripDateLabel').show();
                vReturnValue = false;
            }
            return vReturnValue;
        }

        //单独校验订票数量
        checkTicketCountAlert = function () {
            var vReturnValue = true;
            //预定票数量
            var regTicketCount = /^([1-9]{1}[0-9]{1})|([1-9]{1})$/;
            var value = $('#txtTicketCount').val();
            if (regTicketCount.test(value)) {
                $('#spanAlertTicketCount').hide();
            }
            else {
                $('#spanAlertTicketCount').show();
                vReturnValue = false;
            }
            return vReturnValue;
        }

        //单独校验-取票人姓名
        checkPickName = function () {
            var vReturnValue = true;

            var vSelectPick = $('#selPick').val();
            var vSelectBook = $('#selBook').val();

            var regName = /^(\w|[\u4E00-\u9FA5]){1,20}$/;
            var regMobile = /^1[3,4,5,8][\d]{9}$/;
            var regEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;

            var vPickName = $('#txtPickName').val();
            var vPickMobile = $('#txtPickMobile').val();
            var vPickEmail = $('#txtPickEmail').val();

            var vBookName = $('#txtBookName').val();
            var vBookMobile = $('#txtBookMobile').val();
            var vBookEmail = $('#txtBookEmail').val();
            //预定人信息-取票人姓名
            if (regName.test(vPickName)) {
                $('#spanPickName').hide();
            }
            else {
                $('#spanPickName').show();
                vReturnValue = false;
            }
            return vReturnValue;
        }
        //单独校验-取票人信息：手机、电话
        checkPickMobileEmail = function () {
            var vReturnValue = true;

            var vSelectPick = $('#selPick').val();
            var vSelectBook = $('#selBook').val();

            var regName = /^(\w|[\u4E00-\u9FA5]){1,20}$/;
            var regMobile = /^1[3,4,5,8][\d]{9}$/;
            var regEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;

            var vPickName = $('#txtPickName').val();
            var vPickMobile = $('#txtPickMobile').val();
            var vPickEmail = $('#txtPickEmail').val();

            var vBookName = $('#txtBookName').val();
            var vBookMobile = $('#txtBookMobile').val();
            var vBookEmail = $('#txtBookEmail').val();
            //取票人信息：手机、电话
            if (vSelectPick == '1') {
                if (regMobile.test(vPickMobile)) {
                    $('#spanPickMobile').hide();
                }
                else {
                    $('#spanPickMobile').show();
                    vReturnValue = false;
                }
            }
            else {
                if (regEmail.test(vPickEmail)) {
                    $('#spanPickEmail').hide();
                }
                else {
                    $('#spanPickEmail').show();
                    vReturnValue = false;
                }
            }

            return vReturnValue;
        }
        //单独校验-预定人：名称
        checkBookName = function () {
            var vReturnValue = true;

            var vSelectPick = $('#selPick').val();
            var vSelectBook = $('#selBook').val();

            var regName = /^(\w|[\u4E00-\u9FA5]){1,20}$/;
            var regMobile = /^1[3,4,5,8][\d]{9}$/;
            var regEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;

            var vPickName = $('#txtPickName').val();
            var vPickMobile = $('#txtPickMobile').val();
            var vPickEmail = $('#txtPickEmail').val();

            var vBookName = $('#txtBookName').val();
            var vBookMobile = $('#txtBookMobile').val();
            var vBookEmail = $('#txtBookEmail').val();
            //预定人名称

            if (regName.test(vBookName)) {
                $('#spanBookName').hide();
            }
            else {
                $('#spanBookName').show();
                vReturnValue = false;
            }

            return vReturnValue;
        }
        //单独校验-预定人：手机、邮箱、
        checkBookMobileEmail = function () {

            var vReturnValue = true;

            var vSelectPick = $('#selPick').val();
            var vSelectBook = $('#selBook').val();

            var regName = /^(\w|[\u4E00-\u9FA5]){1,20}$/;
            var regMobile = /^1[3,4,5,8][\d]{9}$/;
            var regEmail = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;

            var vPickName = $('#txtPickName').val();
            var vPickMobile = $('#txtPickMobile').val();
            var vPickEmail = $('#txtPickEmail').val();

            var vBookName = $('#txtBookName').val();
            var vBookMobile = $('#txtBookMobile').val();
            var vBookEmail = $('#txtBookEmail').val();
            //预定人：手机、邮箱、

            if (vSelectBook == '1') {
                if (regMobile.test(vBookMobile)) {
                    $('#spanBookMobile').hide();
                    //alert($('#hidMobileActive').val());
                    //                    if ($('#hidMobileActive').val() == '1') {
                    //                        $('#spanBookMobileCheck').hide();
                    //                    }
                    //                    else {
                    //                        $('#spanBookMobileCheck').show();
                    //                        vReturnValue = false;
                    //                    }
                }
                else {
                    $('#spanBookMobile').show();
                    vReturnValue = false;
                }
            }
            else {
                if (regEmail.test(vBookEmail)) {
                    $('#spanBookEmail').hide();
                }
                else {
                    $('#spanBookEmail').show();
                    vReturnValue = false;
                }
            }
            return vReturnValue;
        }

        //给别人定
        function displaybryd() {
            $('#qprxm').show();
            $('#qprsjhm').show();
            document.getElementById("oneself").className = "";
            document.getElementById("others").className = "now";

            $('#hidBookForState').val(1);
        }
        //给自己预订
        function displayydr() {
            $('#qprxm').hide();
            $('#qprsjhm').hide();
            $('#displayqpryx').hide();
            document.getElementById("oneself").className = "now";
            document.getElementById("others").className = "";

            $('#hidBookForState').val(0);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <input type="hidden" id="hidTotalPrice" runat="server" />
    <input type="hidden" id="hidMobileActive" runat="server" />
    <input type="hidden" id="hidBookForState" value="0" runat="server" />
    <uc1:WUCHeader1 ID="WUCHeader11" runat="server" />
    <div class="cleanFlex managecont">
        <div class="m_top_10">
        </div>
        <!--订单流程-->
        <%
            if (MODEL_BOOK.NJL_CS_BOOK_PAY_TYPE_CODE == "2")
            {
        %>
        <div class="orderMenu">
            <ul class="menuInfo03_02">
                <li class="menu_not" style="width: 334px;">
                    <h2>
                        1、搜索选择农家乐或度假山庄</h2>
                </li>
                <li class="menu_at" style="width: 334px;">
                    <h2>
                        2、填写订单信息</h2>
                </li>
                <li class="menu_sel" style="width: 335px;">
                    <h2>
                        3、预订成功</h2>
                </li>
            </ul>
        </div>
        <%
            }
            else
            { 
        %>
        <div class="orderMenu">
            <ul class="menuInfo04_02">
                <li class="menu_not" style="width: 250px;">
                    <h2>
                        1、搜索选择农家乐或度假山庄</h2>
                </li>
                <li class="menu_at" style="width: 251px;">
                    <h2>
                        2、填写订单信息</h2>
                </li>
                <li class="menu_sel" style="width: 251px;">
                    <h2>
                        3、选择支付方式支付</h2>
                </li>
                <li class="menu_sel" style="width: 251px;">
                    <h2>
                        4、预订成功</h2>
                </li>
            </ul>
        </div>
        <%
            }
        %>
        <div class="reg" style="height: 660px;">
            <div class="m_top_10">
            </div>
            <div style="width: 98%; border: 1px solid #dbf4d0; margin: 0 auto; background: #fff;">
                <!--天气预报-->
                <div class="onlineorder">
                    <p class="centeralign">
                        <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1615605795&site=qq&menu=yes">
                            <img border="0" src="http://wpa.qq.com/pa?p=2:1615605795:42" alt="点击这里给我发消息" title="点击这里给我发消息"/>
                        </a>
                    </p>
                </div>
                <div style="width: 700px; margin: 0 20px;">
                    <div style="border-bottom: 1px solid #dbf4d0; padding: 15px; background: #fff; height: 90px;
                        overflow-y: auto; overflow-x: hidden;">
                        <%=MODEL_BOOK.TICKET_NOTICE %>
                        <p class="m_top_10">
                            发票说明：网络预定门票，非在线支付，农家乐网不提供发票</p>
                    </div>
                    <!--预定信息-->
                    <div class="m_top_20">
                    </div>
                    <table class="tab" width="100%">
                        <tr>
                            <td style="width: 15%;" class="left">
                                <strong>预订门票:</strong>
                            </td>
                            <td colspan="2">
                                <a target="_blank" href="/shangpu/<%=MODEL_COMPANY.ID %>-index.html">
                                    <%=MODEL_COMPANY.COMPANY_NAME%></a>-<%=MODEL_BOOK.BOOK_NAME %>
                            </td>
                        </tr>
                        <tr>
                            <td class="left">
                                <strong>游玩日期:</strong>
                            </td>
                            <td colspan="2">
                                <asp:TextBox ID="txtTripDate" runat="server" CssClass="input" onblur="checkTripDate()"
                                    onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd' })"></asp:TextBox>
                                <span id="spanTripDateLabel" style="display: none;" class="prompt">请选择日期</span>
                                您可于<span id="spanThatDayDeadline"><%=MODEL_BOOK.THAT_DAY_DEADLINE.Value.ToString("HH:mm") %></span>之前预订当天门票
                            </td>
                        </tr>
                        <tr>
                            <td class="left">
                                <strong>预订数量:</strong>
                            </td>
                            <td>
                                <asp:TextBox ID="txtTicketCount" CssClass="input" Width="30" MaxLength="2" Text="1"
                                    onblur="checkTicketCountAlert()" onkeydown='javascript:checkTicketCount()' onkeyup='javascript:checkTicketCount()'
                                    onchange="javascript:checkTicketCount()" runat="server"></asp:TextBox><span id="spanAlertTicketCount"
                                        style="display: none">请输入1-99的数字</span>
                            </td>
                            <td class="book_total">
                                <span id="spanTicketCount">1</span> X <span id="spanLocalPrice">
                                    <%=MODEL_BOOK.LOCAL_PRICE.Value.ToString("0") %></span>元
                            </td>
                        </tr>
                        <tr class="bottom">
                            <td>
                            </td>
                            <td>
                                可获得<strong class="font14 orange04"><%=MODEL_BOOK.BACK_PRICE.Value.ToString("0") %></strong>元点评奖金
                            </td>
                            <td class="book_total">
                                <span>总价:<span id="spanAllPrice"></span>元</span>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="cleanFlex blank">
                </div>
            </div>
            <div class="m_top_20">
            </div>
            <div style="width: 98%; border: 1px solid #dbf4d0; margin: 0 auto; background: #fff;">
                <div style="width: 100%;" class="tabBook">
                    <ul>
                        <li class="bookself" style="width: 495px;"><a id="oneself" href="javascript:displayydr()"
                            title="给自己预定" class="now"></a></li>
                        <li class="bookother" style="width: 485px;"><a id="others" href="javascript:displaybryd()"
                            title="给别人预定"></a></li>
                    </ul>
                </div>
                <table style="width: 95%; margin: 10px auto;" class="tab">
                    <tr>
                        <td class="left" style="width: 18%">
                            <span style="color: #ff0000">*</span><strong>预订人姓名:</strong>
                        </td>
                        <td>
                            <asp:TextBox ID="txtBookName" CssClass="input" runat="server" onblur="checkBookName()"></asp:TextBox>
                            <span id="spanBookName" style="display: none" class="prompt">请输入1-10个汉字或英文</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="left">
                            <span id="spanBookMobileLabel" style="color: #ff0000">*</span><strong>预订人手机号码:</strong>
                        </td>
                        <td>
                            <select id="selBook" onchange="javascript:changeConnect()" disabled="disabled">
                                <option value="1">大陆地区手机</option>
                                <option value="0">非大陆地区手机</option>
                            </select>
                            <input type="text" id="txtBookMobile" maxlength="11" class="input" runat="server"
                                onblur="checkBookMobileEmail()" />
                            <a runat="server" id="aMobileCheck" style="cursor: pointer;" class="orange">验证手机号码</a>
                            <a runat="server" id="aMobileModify" style="cursor: pointer;" class="orange">修改手机号码</a>
                            <span id="spanBookMobile" style="display: none" class="prompt">手机号码以13、14、15或18开头的11位数字，请正确输入联系人手机号码</span>
                            <span id="spanBookMobileCheck" style="display: none" class="prompt">手机号码未验证，请先验证手机号码</span>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td class="left">
                            <span id="spanBookEmailLabel" style="color: #ff0000; display: none;">*</span><strong>预定人电子邮箱:</strong>
                        </td>
                        <td>
                            <span style="float: left">
                                <asp:TextBox ID="txtBookEmail" MaxLength="200" CssClass="input" runat="server" onblur="checkBookMobileEmail()"
                                    Style="width: 280px"></asp:TextBox>
                                <span id="spanBookEmail" style="display: none" class="prompt">请输入正确格式的邮件地址</span></span>
                        </td>
                    </tr>
                    <tr id="qprxm" style="display: none">
                        <td style="width: 18%" class="left">
                            <span style="color: #ff0000">*</span><strong>取票人姓名:</strong>
                        </td>
                        <td>
                            <asp:TextBox ID="txtPickName" CssClass="input" runat="server" onblur="checkPickName()"></asp:TextBox>
                            <span id="spanPickName" style="display: none" class="prompt">请输入1-10个汉字或英文</span>
                        </td>
                    </tr>
                    <tr id="qprsjhm" style="display: none">
                        <td class="left">
                            <span id="spanPickMobileLabel" style="color: #ff0000">*</span><strong>取票人手机号码:</strong>
                        </td>
                        <td>
                            <select id="selPick" onchange="javascript:changeConnect()" disabled="disabled">
                                <option value="1">大陆地区手机</option>
                                <option value="0">非大陆地区手机</option>
                            </select>
                            <asp:TextBox ID="txtPickMobile" MaxLength="11" CssClass="input" runat="server" onblur="checkPickMobileEmail()"></asp:TextBox>
                            <span id="spanPickMobile" style="display: none" class="prompt">手机号码以13、14、15或18开头的11位数字，请正确输入联系人手机号码</span>
                        </td>
                    </tr>
                    <tr id="displayqpryx" style="display: none">
                        <td class="left">
                            <span id="spanPickEmailLabel" style="color: #ff0000; display: none;">*</span><strong>取票人电子邮箱:</strong>
                        </td>
                        <td>
                            <span style="float: left">
                                <asp:TextBox ID="txtPickEmail" MaxLength="200" CssClass="input" runat="server" onblur="checkPickMobileEmail()"
                                    Style="width: 280px"></asp:TextBox>
                                <span id="spanPickEmail" style="display: none" class="prompt">请输入正确格式的邮件地址</span></span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="m_top_20">
            </div>
            <div style="width: 98%;" class="centeralign">
                <asp:Button ID="btnSubmit" runat="server" CssClass="submit_btn" OnClientClick="return checkPersonInfo();"
                    OnClick="btnSubmit_Click" />
            </div>
            <div class="cleanFlex">
            </div>
        </div>
    </div>
    <uc2:WUCFooter1 ID="WUCFooter11" runat="server" />
    <script type="text/javascript">
        GetMobileCheckCode = function () {
            var regMobile = /^1[3,4,5,8][\d]{9}$/;
            var vBookMobile = $('#txtBookMobile').val();

            if (!regMobile.test(vBookMobile)) {
                alert('手机号码有误，应该是以13、14、15或18开头的11位数字');
                return false;
            }

            $.ajax({
                type: 'get',
                url: '/Handle/Handler.ashx',
                data: 'userinfochecktype=create&checkcodetype=mobile&mobile=' + vBookMobile + '&checkcode=&Random=' + Math.random(),
                dataType: 'text',
                success: function (data, textStatus) {
                    if (data == 'OK') {
                        alert('验证码已发送到您的手机，请查收');
                    }
                    if (data == 'OVER') {
                        alert('您今天已经超过获取验证码次数，请联系管理员');
                    }
                    else {
                        //alert('验证码发送失败，请重试');
                    }
                },
                complete: function (XMLHttpRequest, textStatus) {
                    //HideLoading();
                },
                error: function () {
                    //alert("评论失败");
                }
            });
        }

        //验证手机号码
        CheckMobileCheckCode = function () {
            var vInputCheckCode = $('#txtCheckCode').val();

            $.ajax({
                type: 'get',
                url: '/Handle/Handler.ashx',
                data: 'userinfochecktype=get&checkcodetype=mobile&mobile=&checkcode=' + vInputCheckCode + '&Random=' + Math.random(),
                dataType: 'text',
                success: function (data, textStatus) {
                    if (data == 'OK') {
                        alert('恭喜您，手机验证通过');
                        $('#hidMobileActive').val('1');
                        $('#spanBookMobileCheck').hide();
                        $('#txtBookMobile').attr('disabled', true);
                        $('#aMobileModify').show(); //隐藏修改手机号码
                        $('#aMobileCheck').hide(); //显示验证手机号码
                        openDivCheckMobile.close();
                    }
                    else {
                        alert('验证码有误');
                    }
                },
                complete: function (XMLHttpRequest, textStatus) {
                    //HideLoading();
                },
                error: function () {
                    //alert("评论失败");
                }
            });
        }

        //修改手机号码操作
        ModifyMobileBook = function () {
            var regMobile = /^1[3,4,5,8][\d]{9}$/;

            var vOldMobileBook = $('#txtBookMobile').val();
            var vNewMobileBook = $('#txtMobileModify').val();

            if (!regMobile.test(vNewMobileBook)) {
                alert('新设置的手机号码应该是：以13、14、15或18开头的11位数字');
                return;
            }
            if (vNewMobileBook == vOldMobileBook) {
                alert('新号码与原号码相同，请检查新号码是否填写有误');
                return;
            }

            $.ajax({
                type: 'get',
                url: '/Handle/Handler.ashx',
                data: 'userinfochecktype=editmobile&checkcodetype=mobile&mobile=' + vNewMobileBook + '&checkcode=&Random=' + Math.random(),
                dataType: 'text',
                success: function (data, textStatus) {
                    if (data == 'OK') {
                        alert('恭喜您，新号码设置成功！同时已将4位数字的验证码发送到您新设置的手机号码。');
                        $('#hidMobileActive').val('0');
                        $('#txtBookMobile').attr('disabled', false);
                        $('#aMobileModify').hide(); //隐藏修改手机号码
                        $('#aMobileCheck').show(); //显示验证手机号码
                        $('#txtBookMobile').val(vNewMobileBook);
                        $('#spanCheckedMobile').html($('#txtBookMobile').val());
                        $('#txtMobileModify').val('');
                    }
                    else if (data == 'OVER') {
                        alert('您今天已经超过修改手机号码次数，请联系管理员');
                    }
                    else {
                        //alert('修改失败，请重试。如有疑问请联系网站客服人员。');
                    }
                },
                complete: function (XMLHttpRequest, textStatus) {
                    //HideLoading();
                },
                error: function () {
                    //alert("评论失败");
                }
            });
        }

        //修改手机号码后再次验证手机号码
        CheckMobileCheckCodeModify = function () {
            var vInputCheckCode = $('#txtCheckCodeModify').val();

            $.ajax({
                type: 'get',
                url: '/Handle/Handler.ashx',
                data: 'userinfochecktype=get&checkcodetype=mobile&mobile=&checkcode=' + vInputCheckCode + '&Random=' + Math.random(),
                dataType: 'text',
                success: function (data, textStatus) {
                    if (data == 'OK') {
                        alert('恭喜您，手机验证通过');
                        $('#hidMobileActive').val('1');
                        $('#spanBookMobileCheck').hide();
                        $('#txtBookMobile').attr('disabled', true);
                        $('#aMobileModify').show(); //隐藏修改手机号码
                        $('#aMobileCheck').hide(); //显示验证手机号码
                        $('#txtCheckCodeModify').val('');
                        openDivModifyMobile.close();
                    }
                    else {
                        alert('验证码有误');
                        $('#txtCheckCodeModify').val('');
                    }
                },
                complete: function (XMLHttpRequest, textStatus) {
                    //HideLoading();
                },
                error: function () {
                    //alert("评论失败");
                }
            });
        }


        ChangeTextDisable = function () {
            if ($('#txtBookMobile').attr('disabled') == false) {
                $('#txtBookMobile').attr('disabled', true);
            }
            else if ($('#txtBookMobile').attr('disabled') == true) {
                $('#txtBookMobile').attr('disabled', false);
            }
            else {
                $('#txtBookMobile').attr('disabled', false);
            }
        }
    </script>
    <div id="blkMobileCheck" class="blk" style="width: 600px; height: 300px">
        <div class="popup_title">
            <span class="f_right"><a href="javascript:void(0)" id="aMobileCheckClose">关闭</a></span>
            <p>
                <strong class="font14">为了防止您的手机号码被他人恶意使用，我们需要验证此号码为您本人所有</strong></p>
        </div>
        <div>
            <div class="popcode">
                <p class="centeralign">
                    你的手机号码是：<strong class="orange"><span style="font-size: 28px;" id="spanCheckMobile">13702905678</span></strong></p>
                <div class="popcodeintro">
                    <p>
                        <span class="getcode f_left"><a style="cursor: pointer" onclick="javascript:GetMobileCheckCode()">
                            点此按钮您的手机将收<br />
                            到4位数字的验证码短信，填到右侧的框中 </a></span><span style="width: 120px; overflow: hidden; line-height: 20px;
                                float: left; margin-right: 15px;">
                                <input id="txtCheckCode" type="text" class="input" style="width: 60px; margin-left: 20px;"
                                    maxlength="4" /><br />
                                请填写手机收到的4位数字验证码 </span><span style="text-align: center;">
                                    <input type="button" class="redbtn" onclick="javascript:CheckMobileCheckCode()" value="验  证"
                                        style="margin-top: 20px;" />
                                </span>
                    </p>
                </div>
                <div class="cleanFlex">
                </div>
                <div class="code m_top_10">
                    <p class="">
                        如果在30秒之内未收到验证码，请点击<a style="cursor: pointer" onclick="javascript:GetMobileCheckCode()"
                            class="orange">重新获取验证码</a>&nbsp;如有问题，请联系在线客服<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=380911518&site=qq&menu=yes"><img
                                border="0" src="http://wpa.qq.com/pa?p=2:380911518:41" alt="点击这里给我发消息" title="点击这里给我发消息"></a>
                    </p>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var openDivCheckMobile;
        $(document).ready(function () {
            openDivCheckMobile = new PopupLayer({ trigger: "#aMobileCheck", popupBlk: "#blkMobileCheck", closeBtn: "#aMobileCheckClose", useOverlay: true, useFx: true,
                offsets: {
                    x: 0,
                    y: -41
                }
            });
            openDivCheckMobile.doEffects = function (way) {
                if (way == "open") {
                    this.popupLayer.css({ opacity: 0.3 }).show(400, function () {
                        this.popupLayer.animate({
                            left: ($(document).width() - this.popupLayer.width()) / 2,
                            top: (document.documentElement.clientHeight - this.popupLayer.height()) / 2 + $(document).scrollTop(),
                            opacity: 0.8
                        }, 1000, function () { this.popupLayer.css("opacity", 1) } .binding(this));
                    } .binding(this));
                    $('#spanCheckMobile').html($('#txtBookMobile').val());
                }
                else {
                    this.popupLayer.animate({
                        left: this.trigger.offset().left,
                        top: this.trigger.offset().top,
                        opacity: 0.1
                    }, { duration: 500, complete: function () { this.popupLayer.css("opacity", 1); this.popupLayer.hide() } .binding(this) });
                }
            }
        }
        );
    </script>
    <div id="blkMobileModify" class="blk" style="width: 600px; height: 260px">
        <div class="popup_title">
            <span class="f_right"><a href="javascript:void(0)" id="aMobileModifyClose">关闭</a></span>
            <p>
                <strong class="font14">如确实需要修改已验证的手机号码，新号码修改成功后需重新验证号码真实性</strong></p>
        </div>
        <div>
            <div class="popcode">
                <p class="left">
                    您当前的手机号码是：<strong class="orange"><span style="font-size: 28px;" id="spanCheckedMobile">13702905678</span></strong>
                </p>
                <p class="left">
                    您需要修改的手机号码是： <strong class="orange">
                        <input id="txtMobileModify" type="text" class="input" style="width: 200px; margin-left: 20px;"
                            maxlength="11" /></strong>
                    <input type="button" class="redbtn" onclick="javascript:ModifyMobileBook()" value="修  改"
                        style="margin-top: 20px;" />
                </p>
                <p class="left">
                    请填写手机收到的4位数字验证码:
                    <input id="txtCheckCodeModify" type="text" class="input" style="width: 60px; margin-left: 20px;"
                        maxlength="4" />
                    <input type="button" class="redbtn" onclick="javascript:CheckMobileCheckCodeModify()"
                        value="验  证" style="margin-top: 20px;" />
                </p>
                <div class="cleanFlex">
                </div>
                <div class="code">
                    <p class="">
                        如果在30秒之内未收到验证码，请点击<a style="cursor: pointer" onclick="javascript:GetMobileCheckCode()"
                            class="orange">重新获取验证码</a>&nbsp;如有问题，请联系在线客服<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=380911518&site=qq&menu=yes"><img
                                border="0" src="http://wpa.qq.com/pa?p=2:380911518:41" alt="点击这里给我发消息" title="点击这里给我发消息"></a>
                    </p>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var openDivModifyMobile;
        $(document).ready(function () {
            openDivModifyMobile = new PopupLayer({ trigger: "#aMobileModify", popupBlk: "#blkMobileModify", closeBtn: "#aMobileModifyClose", useOverlay: true, useFx: true,
                offsets: {
                    x: 0,
                    y: -41
                }
            });
            openDivModifyMobile.doEffects = function (way) {
                if (way == "open") {
                    this.popupLayer.css({ opacity: 0.3 }).show(400, function () {
                        this.popupLayer.animate({
                            left: ($(document).width() - this.popupLayer.width()) / 2,
                            top: (document.documentElement.clientHeight - this.popupLayer.height()) / 2 + $(document).scrollTop(),
                            opacity: 0.8
                        }, 1000, function () { this.popupLayer.css("opacity", 1) } .binding(this));
                    } .binding(this));
                    $('#spanCheckedMobile').html($('#txtBookMobile').val());
                }
                else {
                    this.popupLayer.animate({
                        left: this.trigger.offset().left,
                        top: this.trigger.offset().top,
                        opacity: 0.1
                    }, { duration: 500, complete: function () { this.popupLayer.css("opacity", 1); this.popupLayer.hide() } .binding(this) });
                }
            }
        }
        );
    </script>
    </form>
</body>
</html>
